<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

class LoginController extends Controller
{
    use AuthenticatesUsers;

    public function showLoginForm()
    {
        return $this->redirTo();
    }

    protected function username()
    {
        return 'email';
    }

    protected function redirTo()
    {
        $this->redirectTo = route('dash');
        return view('login');
    }

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest')->except('logout');
    }

    public function Index()
    {
        return view('login');
    }

}
